<template>
  <div class="detail-box-content" v-if="falg">

    <h1>合成消耗</h1>
    <div class="item">
      <van-row justify="space-between" v-for="(item,index) in newsList" :key="index">
        <van-col span="12">{{item.collectionName}} </van-col>
        <van-col span="12" class="right">X{{item.consumeCollectionNumber}}</van-col>
      </van-row>
    </div>
    <h1>合成获得</h1>
    <p class="get">{{collectionName}}</p>
    <p class="right">{{newsList[0].createTime}} </p>
    <h2>合成获得的藏品，请到“藏品”内查看</h2>
  </div>
</template>
<script>
import { reactive, computed, onMounted, ref } from 'vue'
import { useStore } from "vuex";
import { useRouter } from "vue-router"
import { Toast } from 'vant';
import { mixRedode } from '@/api/public'
export default {

  setup() {
    const store = useStore();
    const router = useRouter()
    const falg = ref(false)
    const user_info = computed(() => {
      return store.getters.user_info
    })
    const newsList = ref()
    const collectionName = ref('')
    onMounted(() => {
      const data = { userCollectionId: router.currentRoute.value.query.id, page: 1, size: 999999 }
      mixRedode(data).then(res => {
        console.log(res.data.data)
        newsList.value = res.data.data.collectionSynthesisLogs
        collectionName.value = res.data.data.collectionName
        falg.value = true
      })
    })
    const formData = reactive({


    })
    const goMore = (id) => {
      router.push({
        path: '/me/newsInfo',
        query: {
          id: id
        }
      })
    }
    return {
      formData,
      newsList,
      goMore,
      falg,
      collectionName
    }
  }
}
</script>
<style lang="less" scoped>
.detail-box-content {
  background: #282a2c;
  border-radius: 20px;
  padding: 30px;
  margin: 30px 20px;
  .get {
    font-weight: 400;
    color: white;
    font-size: 30px;
  }
  h1 {
    font-weight: 400;
    color: white;
    font-size: 34px;
  }
  h2 {
    text-align: center;
    font-size: 22px;
    font-family: Source Han Sans CN;
    font-weight: 300;
    color: #b9c4c7;
  }
  .right {
    color: #999;
    text-align: right;
    font-size: 28px;
  }
  .item {
    // background: #101010;
    border-radius: 20px;
    // padding: 30px;
    display: block;
    color: #efefef;
    line-height: 68px;
    font-size: 30px;

    &:deep(.van-row--justify-space-between) {
      border-bottom: 1px solid #999;
    }
  }
}
</style>